
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:head>
		<style>
body {
	background-color: #F7F7F7;
	background: url(../include/images/login-bg.png);
	font-size: 12px;
}

.loginPanel {
	width: 500px;
	margin: 0 auto;
	margin-top: 180px;
}

#verifyCode {
	vertical-align: middle;
}
</style>
		<link href="#{request.contextPath}/include/css/admin.css"
			type="text/css" rel="stylesheet" />
		<link href="#{request.contextPath}/include/css/login.css"
			type="text/css" rel="stylesheet" />
	</h:head>
	<f:event type="preRenderComponent"
		listener="#{loginUtil.setSession('loginType','admin')}"></f:event>
	<form action="#{request.contextPath}/login" method="post"
		accept-charset="UTF-8">
		<p:panel header="你先登录上，完事我告诉你噶哈" id="loginPanel"
			styleClass="loginPanel">
			<ui:fragment
				rendered="#{ not empty requestScope['SPRING_SECURITY_LAST_EXCEPTION'] and requestScope['SPRING_SECURITY_LAST_EXCEPTION'].message ne 'Authentication method not supported: GET'}">
				<script>
					$(function() {
						growl
								.renderMessage({
									summary : '错误',
									detail : '#{requestScope['SPRING_SECURITY_LAST_EXCEPTION'].message}',
									severity : 'error'
								});
					});
				</script>
				<!--             <li style="color: red;"> -->
				<!--                 #{requestScope['SPRING_SECURITY_LAST_EXCEPTION'].message} -->
				<!--             </li> -->
			</ui:fragment>
			<ui:fragment
				rendered="#{not empty request.getParameter('spring-security-redirect')}">
				<input type="hidden" name="spring-security-redirect"
					value="#{request.getParameter('spring-security-redirect')}"></input>
			</ui:fragment>
			<!--         	<input type="hidden" name="spring-security-fail-redirect" value="/dfdfd"></input> -->
			<h:panelGrid columns="2">
				<div class="input_outer">
					<span class="u_user"></span>
					<p:inputText styleClass="text" id="j_username" required="true"></p:inputText>
				</div>

				<div class="input_outer">
					<span class="us_uer"></span>
					<p:password styleClass="text" id="j_password"></p:password>
				</div>
				<h:outputLabel
					rendered="#{sessionScope.need_validate_code or configHome.getConfigValue('login_fail_max_times') eq '0'}">
					<p:inputText id="captcha_input" style="width:60px;"></p:inputText>
					<img alt="点击刷新" id="verifyCode"
						src="#{request.contextPath}/verifyCodeServlet"
						onclick="this.src='#{request.contextPath}/verifyCodeServlet?'+new Date().getTime()" />
				</h:outputLabel>

				<p:spacer></p:spacer>
				<p:outputPanel>
					<p:commandButton value="登录" onclick="submit();"></p:commandButton>
				</p:outputPanel>
			</h:panelGrid>
			<div class="login-logo">
				<img
					src="#{request.contextPath}/include/images/admin/login-logo.png"
					style="width:135px;height:120px;" />
			</div>
			<div class="clear"></div>
			<f:facet name="footer">
            
             技术部的用来研究订不订食堂饭的系统.
        </f:facet>
		</p:panel>
	</form>

</f:view>
